-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable type casting for pow() int arguments #543
Conversation
Interesting and very strange 😅. Thanks for the diffs. Is the performance dip consistent with different opencl implementations. |
Yes, somewhat. With pocl-cuda, there is a ~10%-20% slowdown (see e.g. illinois-ceesd/mirgecom#1055 (comment)). I haven't tried other CL implementations yet. |
e99c817
to
5e3a141
Compare
This is quite messy, but I think it is ready for a first look @inducer @kaushikcfd |
LGTM. I don't mind it. (The timings are something of a puzzle... but these changes don't seem to be breaking the CI, so should be fine :)) |
76b3e66
to
71eec4e
Compare
pytato/utils.py
Outdated
import operator | ||
# See https://github.com/inducer/pytato/issues/542 | ||
# on why pow() + integers is not typecast to float or complex. | ||
if not ((op == prim.Power or op == operator.pow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not loving that we're identifying the operator by its callable; that's brittle. (Somebody could just wrap things in a lambda
and this would forget what it was doing.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but I'm not sure how to improve this. Do you have a suggestion?
Edit: add an argument to broadcast_binary_op
that identifies it as pow.
508a181
to
f1b81aa
Compare
f1b81aa
to
ed572c0
Compare
LGTM. @kaushikcfd? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes (works around?) #542.
cc #538 illinois-ceesd/mirgecom#1055
Please squash